@tailwind base;
@tailwind components;
@tailwind utilities;

/* 去掉code的引号 */
.prose
  :where(code):not(
    :where([class~="not-prose"], [class~="not-prose"] *)
  )::before {
  content: "";
}

.prose
  :where(code):not(
    :where([class~="not-prose"], [class~="not-prose"] *)
  )::after {
  content: "";
}

/* 去掉quote的引号 */
.prose
  :where(blockquote p:first-of-type):not(
    :where([class~="not-prose"], [class~="not-prose"] *)
  )::before {
  content: "";
}

.prose
  :where(blockquote p:last-of-type):not(
    :where([class~="not-prose"], [class~="not-prose"] *)
  )::after {
  content: "";
}

.prose :where(code):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
  font-weight: normal;
}

.tiptap.progress-editor {
  width: 100%; 
  max-width: 100%;

  &:focus {
    outline: none;
  }

  :first-child {
    margin-top: 0;
  }

  ul,
  ol {
    padding: 0 1rem;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    line-height: 1.1;
  }

  code {
    padding: 0.25em;
    border-radius: 0.25em;
    background-color: rgba(#616161, 0.1);
    color: #616161;
    box-decoration-break: clone;
  }

  pre {
    background: #0d0d0d;
    color: #fff;
    font-family: "JetBrainsMono", monospace;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;

    code {
      color: inherit;
      padding: 0;
      background: none;
      font-size: 0.8rem;
    }

    .hljs-comment,
    .hljs-quote {
      color: #787878;
    }

    .hljs-variable,
    .hljs-template-variable,
    .hljs-attribute,
    .hljs-tag,
    .hljs-name,
    .hljs-regexp,
    .hljs-link,
    .hljs-name,
    .hljs-selector-id,
    .hljs-selector-class {
      color: #f98181;
    }

    .hljs-number,
    .hljs-meta,
    .hljs-built_in,
    .hljs-builtin-name,
    .hljs-literal,
    .hljs-type,
    .hljs-params {
      color: #fbbc88;
    }

    .hljs-string,
    .hljs-symbol,
    .hljs-bullet {
      color: #b9f18d;
    }

    .hljs-title,
    .hljs-section {
      color: #faf594;
    }

    .hljs-keyword,
    .hljs-selector-tag {
      color: #70cff8;
    }

    .hljs-emphasis {
      font-style: italic;
    }

    .hljs-strong {
      font-weight: 700;
    }
  }

  img {
    max-width: 100%;
    height: auto;
  }

  hr {
    margin: 1rem 0;
  }

  blockquote {
    padding-left: 1rem;
    border-left: 2px solid rgba(#0d0d0d, 0.1);
  }

  /* Table-specific styling */
  table {
    border-collapse: collapse;
    margin: 0;
    overflow: hidden;
    table-layout: fixed;
    width: 100%;

    td,
    th {
      border: 1px solid #ced4da;
      box-sizing: border-box;
      min-width: 1em;
      padding: 6px 8px;
      position: relative;
      vertical-align: top;

      > * {
        margin-bottom: 0;
      }
    }

    th {
      background-color: #f1f3f5;
      font-weight: bold;
      text-align: left;
    }

    .selectedCell:after {
      background: rgba(200, 200, 255, 0.4);
      content: "";
      left: 0;
      right: 0;
      top: 0;
      bottom: 0;
      pointer-events: none;
      position: absolute;
      z-index: 2;
    }

    .column-resize-handle {
      background-color: #adf;
      bottom: -2px;
      pointer-events: none;
      position: absolute;
      right: -2px;
      top: 0;
      width: 4px;
    }
  }

  .tableWrapper {
    margin: 1.5rem 0;
    overflow-x: auto;
  }

  .resize-cursor {
    cursor: ew-resize;
    cursor: col-resize;
  }

  /* Task list styles */
  ul[data-type="taskList"] {
    list-style: none;
    padding: 0;

    p {
      margin: 0;
    }

    li {
      display: flex;

      > label {
        flex: 0 0 auto;
        margin-right: 0.5rem;
        user-select: none;
      }

      > div {
        flex: 1 1 auto;
      }

      ul li,
      ol li {
        display: list-item;
      }

      ul[data-type="taskList"] > li {
        display: flex;
      }
    }
  }

  a {
    color: #c084fc;
    cursor: pointer;

    &:hover {
      color: #a855f7;
    }
  }
  p.is-empty::before {
    color: #94a3b8;
    content: attr(data-placeholder);
    float: left;
    height: 0;
    pointer-events: none;
  }
}
.tippy-box[data-theme~=light] {
  font-size: 0.875rem;
  color: rgb(148 163 184);
}
.dark .tippy-box[data-theme~=light] {
  color: #404040;
}
.dark .tippy-box[data-theme~=light]>.tippy-svg-arrow {
  fill: #404040;
}
.dark .tippy-box[data-theme~=light]>.tippy-backdrop {
  background-color: #404040;
}
.dark .tippy-box[data-theme~=light] {
  background: #404040;
  color: rgb(203 213 225);
}